return xshandle().rm(path)
def remove(self, *args):
+ """If no arguments are given, remove this transaction's path.
+ Otherwise, treat each argument as a subpath to this transaction's
+ path, and remove each of those instead.
+ """
if len(args) == 0:
- raise TypeError
- for key in args:
- self._remove(key)
+ xshandle().rm(self.path)
+ else:
+ for key in args:
+ self._remove(key)
def _list(self, key):
path = "%s/%s" % (self.path, key)
Write = classmethod(Write)
def Remove(cls, path, *args):
+ """If only one argument is given (path), remove it. Otherwise, treat
+ each further argument as a subpath to the given path, and remove each
+ of those instead. This operation is performed inside a transaction.
+ """
while True:
t = cls(path)
try: